package com.patrol.logisticsmanage.net;

public class BaseReponse<T> {
    private static int SUCCESS_CODE=200;//成功的code
    private int code;                   //响应码
    private String message;             //提示信息
    private T result;                  //返回的具体数据
    private boolean success;

    public boolean isSuccess(){
        return getCode()==SUCCESS_CODE||success==true;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public static int getSuccessCode() {
        return SUCCESS_CODE;
    }

    public static void setSuccessCode(int successCode) {
        SUCCESS_CODE = successCode;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getResults() {
        return result;
    }

    public void setResults(T results) {
        this.result = results;
    }

    @Override
    public String toString() {
        return "BaseReponse{" +
                "code=" + code +
                ", message='" + message + '\'' +
                ", results=" + result +
                '}';
    }
}

